package com.tl.boot.entity.user.form;

import com.tl.boot.common.enums.ResultEnum;
import com.tl.boot.common.enums.StatusEnum;
import com.tl.boot.common.exception.BaseException;
import com.tl.boot.entity.demo.form.Base.BaseForm;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

/**
 * com.tl.boot.entity.user.form -- AddUserInfoForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/16 16:31
 */
public class AddUserInfoForm extends BaseForm {
    @ApiModelProperty( value = "用户名", name = "username", example = "jack" )
    private String username;
    @ApiModelProperty( value = "密码", name = "userPassword", example = "asdfads" )
    private String userPassword;
    @ApiModelProperty( value = "真实姓名", name = "realName", example = "张三丰" )
    private String realName;
    @ApiModelProperty( value = "用户状态 VALID INVALID", name = "userStatusEnum", example = "VALID" )
    private StatusEnum userStatusEnum;
    @ApiModelProperty( value = "菜单类型", name = "menuType", example = "I" )
    private String menuType;
//    @ApiModelProperty( value = "创建时间", name = "resCode", example = "addUser" )
//    private Date createTime;
//    @ApiModelProperty( value = "最后修改时间", name = "resCode", example = "addUser" )
//    private Date lastmodiTime;
//    @ApiModelProperty( value = "锁定时间", name = "resCode", example = "addUser" )
//    private Date lockTime;
//    @ApiModelProperty( value = "资源编码", name = "resCode", example = "addUser" )
//    private Date passExpiryTime;
//    @ApiModelProperty( value = "资源编码", name = "resCode", example = "addUser" )
//    private Date effictiveBeginTime;
//    @ApiModelProperty( value = "资源编码", name = "resCode", example = "addUser" )
//    private Date effictiveEndTime;
    @ApiModelProperty( value = "组织机构id", name = "orgId", example = "1" )
    private Long orgId;
    @ApiModelProperty( value = "备注", name = "remark", example = "备注" )
    private String remark;
    @ApiModelProperty( value = "扩展信息", name = "reserve", example = "扩展信息" )
    private String reserve;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserPassword() {
        return userPassword;
    }

    public void setUserPassword(String userPassword) {
        this.userPassword = userPassword;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public StatusEnum getUserStatusEnum() {
        return userStatusEnum;
    }

    public void setUserStatusEnum(StatusEnum userStatusEnum) {
        this.userStatusEnum = userStatusEnum;
    }

    public String getMenuType() {
        return menuType;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType;
    }

    public Long getOrgId() {
        return orgId;
    }

    public void setOrgId(Long orgId) {
        this.orgId = orgId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getReserve() {
        return reserve;
    }

    public void setReserve(String reserve) {
        this.reserve = reserve;
    }

    @Override
    public void checkParam() {
        if (StringUtils.isBlank(this.username) ||
                StringUtils.isBlank(this.userPassword) ||
                StringUtils.isBlank(this.realName)) {
            throw new BaseException(ResultEnum.REQUEST_PARAM_ILLEGAL);
        }
    }
}
